package dongwu;

class Dog extends Animal implements Trainable, Swimmable {
    private String breed;

    // 构造方法  //
    public Dog(String name, int age, String breed) {
        super(name, age);
        this.breed = breed;
    }

    // get breed  //
    public String getBreed() {
        return breed;
    }

    @Override
    public void makeSound() {
        System.out.println(getName() + " says: wang");
    }

    // Trainable接口  //
    @Override
    public void train() {
        System.out.println(getName() + " is trainable");
    }

    // Swimmable接口  //
    @Override
    public void swim() {
        System.out.println(getName() + " can swim");
    }
}